import request from '../utils/request'
const api_name = "/order"

export default {
    // 获取购买状态
    isBought(courdeId) {
        return request({
            url: `${api_name}/isbought/${courdeId}`,
            method: "get",
        })
    },
    // 获取指定课程的订单信息
    showInfo(courseId) {
        return request({
            url: `${api_name}/info/${courseId}`,
            method: "get",
        })
    },
    // 根据课程编号创建课程id 
    createOrder(courseId) {
        return request({
            url: `${api_name}/${courseId}`,
            method: "post",
        })
    },
    // 获取用户的所有订单
    getOrders() {
        return request({
            url: `${api_name}/list`,
            method: "get",
        })
    },
}